#include "options.h"
#include "ui_options.h"
#include "QDebug"
options::options(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::options)
{
    ui->setupUi(this);
}

void options::setIconAndText(const QString &optIcon, const QString &optText,int pos)
{
    QPixmap pixmap(optIcon);
    pixmap = pixmap.scaled(30,30);
    ui->opt_picture->setPixmap(pixmap);
    ui->opt_text->setText(optText);
    id = pos;
}

void options::mousePressEvent(QMouseEvent *event)
{
    (void)event;
    emit optClicked(id);
}

void options::enterEvent(QEvent *event)
{
    (void)event;
    setStyleSheet("background-color: rgb(203, 203, 203);"\
                  "border-radius: 25px;"\
                  "border: 5px solid #BCBCBC;"\
                  "background-repeat: no-repeat;"\
                  "background-position: center center;");
}

void options::leaveEvent(QEvent *event)
{
    (void)event;
    setStyleSheet("background-color: rgb(255, 255, 255);"\
                  "border-radius: 25px;"\
                  "border: 5px solid #BCBCBC;"\
                  "background-repeat: no-repeat;"\
                  "background-position: center center;");
}

options::~options()
{
    delete ui;
}
